Skip to content

feat(commands): add ping command#240

Merged
Akinator31 merged 5 commits intomainfrom
239-ping-command
Nov 18, 2025
Merged

feat(commands): add ping command#240
Akinator31 merged 5 commits intomainfrom
239-ping-command

Conversation

@Akinator31
Copy link
Copy Markdown
Member

Add a ping command to display the latency between the bot and the Discord gateway (heartbeat latency).

@Akinator31 Akinator31 self-assigned this Nov 17, 2025
@Akinator31 Akinator31 linked an issue Nov 17, 2025 that may be closed by this pull request
@Akinator31 Akinator31 requested a review from Copilot November 18, 2025 08:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new ping command to display bot latency metrics, including gateway heartbeat latency, REST API latency, and message send latency. The command is available both as a text command (!ping) and a slash command (/ping).

Key changes:

  • Implemented ping command with both text and slash command interfaces
  • Added internationalization support for English and French
  • Integrated ShardManager into the bot context for accessing gateway latency
  • Applied code formatting improvements in config.rs

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
rustmail/src/bot.rs Added ShardManagerKey type and integration, updated random number generation API
rustmail/src/commands/ping/text_command/ping.rs Implemented text-based ping command with latency measurement
rustmail/src/commands/ping/slash_command/ping.rs Implemented slash command version of ping with latency measurement
rustmail/src/commands/ping/text_command/mod.rs Module export for text command
rustmail/src/commands/ping/slash_command/mod.rs Module export for slash command
rustmail/src/commands/ping/mod.rs Main module file for ping command
rustmail/src/commands/mod.rs Registered ping command module
rustmail/src/handlers/guild_messages_handler.rs Added ping to text command handler
rustmail/src/i18n/language/en.rs Added English translations for ping command
rustmail/src/i18n/language/fr.rs Added French translations for ping command
rustmail/src/utils/message/message_builder.rs Modified edit message builder to set empty content when using embeds
rustmail/src/config.rs Code formatting improvements for readability

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rustmail/src/commands/ping/text_command/ping.rs Outdated
Comment thread rustmail/src/commands/ping/slash_command/ping.rs Outdated
Comment thread rustmail/src/commands/ping/text_command/ping.rs Outdated
Comment thread rustmail/src/commands/ping/slash_command/ping.rs Outdated
Comment thread rustmail/src/i18n/language/en.rs Outdated
Comment thread rustmail/src/i18n/language/en.rs Outdated
Comment thread rustmail/src/bot.rs
Comment thread rustmail/src/utils/message/message_builder.rs
@Akinator31 Akinator31 merged commit f53e473 into main Nov 18, 2025
6 checks passed
@Akinator31 Akinator31 deleted the 239-ping-command branch November 18, 2025 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ping command

2 participants